Reduce the number of colors by converting to indexed image matlabindexed imagecolors Load an image and convert it to index image with lower number of colors